package com.miyake.loveviewweb.shared;

public class CommonTool {

    public static Number getMax(double[] y) {
        double max = Double.NEGATIVE_INFINITY;
        for (int i = 0; i < y.length; i++) {
            if (max < y[i]) {
                max = y[i];
            }
        }
        return max;
    }
    
    public static Number getMin(double[] y) {
        double min = Double.POSITIVE_INFINITY;
        for (int i = 0; i < y.length; i++) {
            if (min > y[i]) {
                min = y[i];
            }
        }
        return min;
    }
}
